/**
 * Created by 小敏哥 on 2017/12/6.
 */
import React, {Component} from 'react';
import {connect} from 'react-redux';
import style from './index.scss';
import ItemList from '../../../../../../../../src/js/components/itemList';
import InputWithDelete from '../../../../../../../js/components/inputWithDelete';
class InputContent extends Component {
    constructor(props) {
        super(props);
        this.state = {
        }
    }

    static propTypes = {
        admissibilityNumCallBack: React.PropTypes.func.isRequired,//驾驶人姓名回调
        driverNameCallBack: React.PropTypes.func.isRequired,//驾驶人身份证回调
    };

    componentDidMount() {
    }

    render() {
        return <div className={style.inputContent}>
            <p className={style.title}><img src="./images/Rectangle 2.png"/> 机动车牌信息</p>
            <ItemList borderPaddingLeft="20px">
                <InputWithDelete storageKey="driverName" title="受理编号 " regular="^[a-zA-Z0-9]{2,20}$"
                                 placeholder="请输入受理编号"
                                 maxLength={20}
                                 errorCallBack={(value) => {
                                     this.props.admissibilityNumCallBack(value, false);
                                 }} currentCallBack={(value) => {
                    this.props.admissibilityNumCallBack(value, true);
                }}/>
                <InputWithDelete storageKey="driverIdCard" title="车主名称" placeholder="请输入车主名称"
                                 regular="^\S{2,60}$"
                                 maxLength={60}
                                 errorCallBack={(value) => {
                                     this.props.driverNameCallBack(value, false);
                                 }} currentCallBack={(value) => {
                    this.props.driverNameCallBack(value, true);
                }}/>
            </ItemList>
        </div>
    }
}

export default connect()(InputContent);